package com.caochenlei.abstractFactory.factory;

import com.caochenlei.abstractFactory.color.Blue;
import com.caochenlei.abstractFactory.color.Color;
import com.caochenlei.abstractFactory.color.Green;
import com.caochenlei.abstractFactory.color.Red;
import com.caochenlei.abstractFactory.shape.Shape;

public class ColorFactory extends AbstractFactory {
    @Override
    public Shape createShape(String shapeType) {
        return null;
    }

    @Override
    public Color createColor(String colorType) {
        if ("Red".equalsIgnoreCase(colorType)) {
            return new Red();
        }
        if ("Green".equalsIgnoreCase(colorType)) {
            return new Green();
        }
        if ("Blue".equalsIgnoreCase(colorType)) {
            return new Blue();
        }
        return null;
    }
}
